home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / Notification.p < prev    next >
Text File  |  1996-05-01  |  5KB  |  167 lines

  1. {
  2.      File:        Notification.p
  3.  
  4.      Contains:    Notification Manager interfaces
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Notification;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __NOTIFICATION__}
  28. {$SETC __NOTIFICATION__ := 1}
  29.  
  30. {$I+}
  31. {$SETC NotificationIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
  38. {$IFC UNDEFINED __OSUTILS__}
  39. {$I OSUtils.p}
  40. {$ENDC}
  41. {$ENDC}
  42. {$IFC UNDEFINED __COLLECTIONS__}
  43. {$I Collections.p}
  44. {$ENDC}
  45. {$IFC UNDEFINED __KERNEL__}
  46. {$I Kernel.p}
  47. {$ENDC}
  48.  
  49. {$PUSH}
  50. {$ALIGN MAC68K}
  51. {$LibExport+}
  52.  
  53. {  ------------------  }
  54. {$IFC FOR_SYSTEM8_PREEMPTIVE }
  55.  
  56. TYPE
  57.     NotificationRef = ^LONGINT;
  58. {  notification status flags  }
  59.  
  60. CONST
  61.     kInvalidNotification        = 1;                            {  notification ref invalid         }
  62.     kUnSentNotification            = 2;                            {  notification not yet sent     }
  63.     kPostedNotification            = 3;                            {  notification has been posted     }
  64.  
  65.  
  66. TYPE
  67.     NotificationStatus                    = UInt32;
  68. {  notification tags  }
  69.  
  70. CONST
  71.     kNotificationTypeTag        = 'type';                        {  type of notification (multiple types allowed)  }
  72.     kNotificationRefTag            = 'nref';                        {  notification ref (usually retrieved at completion)  }
  73.     kTextNotificationTag        = 'text';                        {  ASCII text  }
  74.     kTextObjectNotificationTag    = 'tobj';                        {  text object model format text  }
  75.     kSoundNotificationTag        = 'snd ';                        {  sound data in format of 'snd ' resource  }
  76.     kSmall8BitIconTag            = 'ics8';                        {  8-bit icon  }
  77.     kSmall4BitIconTag            = 'ics4';                        {  4-bit icon  }
  78.     kSmall1BitMaskIconTag        = 'ics#';                        {  1-bit icon w/mask  }
  79.     kProcessSerialNumberTag        = 'psn ';                        {  psn we wish to mark  }
  80.  
  81. {  notification module identifiers  }
  82.     kAlertNotifier                = 'alrt';                        {  display a modal alert with OK button  }
  83.     kSoundNotifier                = 'snd ';                        {  play a sound  }
  84.     kProcessMenuNotifier        = 'pmnu';                        {  flash icon in title of process menu  }
  85.     kAppleMenuNotifier            = 'amnu';                        {  flash icon in title of apple menu  }
  86.     kMenuMarkNotifier            = 'mmrk';                        {  put a mark in the process menu  }
  87.  
  88.  
  89. TYPE
  90.     NotifierType                        = OSType;
  91. {  notification posting options  }
  92.  
  93. CONST
  94.     kAutoDisposeOnCompletionMask = $00000001;                    {  dispose the notification request on completion  }
  95.  
  96.  
  97. TYPE
  98.     NotificationOptions                    = OptionBits;
  99. {  ------------------  }
  100. FUNCTION NewNotificationRef(VAR notification: NotificationRef): OSStatus;
  101. FUNCTION AddNotificationCollectionItem(notification: NotificationRef; tag: CollectionTag; id: UInt32; itemData: UNIV Ptr; itemSize: ByteCount): OSStatus;
  102. FUNCTION GetNotificationCollectionItem(notification: NotificationRef; tag: CollectionTag; id: UInt32; VAR dataPtr: UNIV Ptr; VAR itemSize: ByteCount): OSStatus;
  103. FUNCTION PostNotification(notification: NotificationRef; {CONST}VAR completion: KernelNotification; timeOut: Duration; postingOptions: NotificationOptions): OSStatus;
  104. FUNCTION GetNotificationStatus(notification: NotificationRef): NotificationStatus;
  105. FUNCTION DisposeNotificationRef(notification: NotificationRef): OSStatus;
  106. FUNCTION NewNotificationRefFromMemory(messageBuffer: UNIV Ptr; size: ByteCount; VAR notification: NotificationRef): OSStatus;
  107. FUNCTION GetFlattenedNotificationSize(notification: NotificationRef): ByteCount;
  108. FUNCTION FlattenNotification(notification: NotificationRef; buffer: UNIV Ptr): OSStatus;
  109. {$ENDC}
  110. {  ------------------  }
  111. {  ------------------  }
  112. {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
  113.  
  114. TYPE
  115.     NMRecPtr = ^NMRec;
  116.     NMProcPtr = ProcPtr;  { PROCEDURE NM(nmReqPtr: NMRecPtr); }
  117.  
  118.     NMUPP = UniversalProcPtr;
  119.     NMRec = RECORD
  120.         qLink:                    QElemPtr;                                {  next queue entry }
  121.         qType:                    INTEGER;                                {  queue type -- ORD(nmType) = 8 }
  122.         nmFlags:                INTEGER;                                {  reserved }
  123.         nmPrivate:                LONGINT;                                {  reserved }
  124.         nmReserved:                INTEGER;                                {  reserved }
  125.         nmMark:                    INTEGER;                                {  item to mark in Apple menu }
  126.         nmIcon:                    Handle;                                    {  handle to small icon }
  127.         nmSound:                Handle;                                    {  handle to sound record }
  128.         nmStr:                    StringPtr;                                {  string to appear in alert }
  129.         nmResp:                    NMUPP;                                    {  pointer to response routine }
  130.         nmRefCon:                LONGINT;                                {  for application use }
  131.     END;
  132.  
  133.  
  134. CONST
  135.     uppNMProcInfo = $000000C0;
  136.  
  137. PROCEDURE CallNMProc(nmReqPtr: NMRecPtr; userRoutine: NMUPP);
  138.     {$IFC NOT GENERATINGCFM}
  139.     INLINE $205F, $4E90;
  140.     {$ENDC}
  141.  
  142. FUNCTION NewNMProc(userRoutine: NMProcPtr): NMUPP;
  143.     {$IFC NOT GENERATINGCFM }
  144.     INLINE $2E9F;
  145.     {$ENDC}
  146. {  ------------------  }
  147. FUNCTION NMInstall(nmReqPtr: NMRecPtr): OSErr;
  148.     {$IFC NOT GENERATINGCFM}
  149.     INLINE $205F, $A05E, $3E80;
  150.     {$ENDC}
  151. FUNCTION NMRemove(nmReqPtr: NMRecPtr): OSErr;
  152.     {$IFC NOT GENERATINGCFM}
  153.     INLINE $205F, $A05F, $3E80;
  154.     {$ENDC}
  155. {$ENDC}
  156. {  ------------------  }
  157. {$ALIGN RESET}
  158. {$POP}
  159.  
  160. {$SETC UsingIncludes := NotificationIncludes}
  161.  
  162. {$ENDC} {__NOTIFICATION__}
  163.  
  164. {$IFC NOT UsingIncludes}
  165.  END.
  166. {$ENDC}
  167.